struct MyStruct {
mut:
	n int
}

fn main() {
	mut q := MyStruct{
		n: 7
	}
	
	w := MyStruct{
		n: 13
	}
	
	// references of `q` and `w` are passed, and leaving `main()`
	// but the lifetime of these references lies inside the scope of `main()`
	// so `q` and `w` are allocated on the stack
	x := q.f(&w) 
	println('q: $q\nx: $x')
}

// the references to q and w are only borrowed to f()
// only used for reading and modifying the referred values
fn (mut a MyStruct) f(b &MyStruct) int {
	a.n += b.n
	x := a.n * b.n
	
	return x
}
